package com.sang.web;

import com.sang.pojo.Order;
import com.sang.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping
public class OrderController {
//    @Autowired
//    SpringBootBusTest springBootBusTest;

    @Autowired
    OrderService orderService;
    //这里应该传递过来一个什么对象  传递一个查询用户信息的username对象
    @GetMapping("orderService/{id}")
    public List<Order> findOrderByUserName(@PathVariable("id") String id){
//        System.out.println("根据配置文件修改后的端口地址为"+springBootBusTest.getPort());
        return orderService.findOrderByUserId(id);
    }
}
